<html>
<head><meta charset="utf-8"><title>are we still avoiding internal specialization? · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/are.20we.20still.20avoiding.20internal.20specialization.3F.html">are we still avoiding internal specialization?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210826649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/are%20we%20still%20avoiding%20internal%20specialization%3F/near/210826649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ashley Mannix <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/are.20we.20still.20avoiding.20internal.20specialization.3F.html#210826649">(Sep 22 2020 at 04:13)</a>:</h4>
<p>Hey all! I've been assigned a PR that uses specialization internally to optimize some <code>std::io</code> functions for cases where sources and destinations are files. I _think_ this is just relying on <code>min_specialization</code> but haven't really checked yet.</p>
<p>We had a "ban" on any new specialization use earlier because of soundness issues. Is that still the case? Does that also apply to <code>min_specialization</code>?</p>



<a name="210828015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/are%20we%20still%20avoiding%20internal%20specialization%3F/near/210828015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/are.20we.20still.20avoiding.20internal.20specialization.3F.html#210828015">(Sep 22 2020 at 04:50)</a>:</h4>
<p>It is more kind of question for t-compiler to me.</p>



<a name="210830409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/are%20we%20still%20avoiding%20internal%20specialization%3F/near/210830409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/are.20we.20still.20avoiding.20internal.20specialization.3F.html#210830409">(Sep 22 2020 at 05:56)</a>:</h4>
<p>As I understand it, the entire point of <code>min_specialization</code> is to be the subset of specialization that we are willing to continue using.</p>



<a name="211359433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/are%20we%20still%20avoiding%20internal%20specialization%3F/near/211359433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/are.20we.20still.20avoiding.20internal.20specialization.3F.html#211359433">(Sep 26 2020 at 13:10)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/219381-t-libs/topic/are.20we.20still.20avoiding.20internal.20specialization.3F/near/210830409">said</a>:</p>
<blockquote>
<p>As I understand it, the entire point of <code>min_specialization</code> is to be the subset of specialization that we are willing to continue using.</p>
</blockquote>
<p>yes, that is my understanding as well. So <span class="user-mention" data-user-id="204346">@Ashley Mannix</span> I'd make sure that the affected crate(s) do not use <code>feature(specialization)</code>, and then you should be good</p>



<a name="211359437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/are%20we%20still%20avoiding%20internal%20specialization%3F/near/211359437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/are.20we.20still.20avoiding.20internal.20specialization.3F.html#211359437">(Sep 26 2020 at 13:10)</a>:</h4>
<p>(deleted)</p>



<a name="211359442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/are%20we%20still%20avoiding%20internal%20specialization%3F/near/211359442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/are.20we.20still.20avoiding.20internal.20specialization.3F.html#211359442">(Sep 26 2020 at 13:10)</a>:</h4>
<p>^ <span class="user-mention" data-user-id="116118">@Matthew Jasper</span></p>



<a name="211360398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/are%20we%20still%20avoiding%20internal%20specialization%3F/near/211360398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/are.20we.20still.20avoiding.20internal.20specialization.3F.html#211360398">(Sep 26 2020 at 13:36)</a>:</h4>
<p>We shouldn't have any <code>feature(specialization)</code> left in the compiler/standard library so you should be good.  <code>rustc_unsafe_specialization_marker</code> is still  used in a few places, but new uses should be avoided.</p>



<a name="211395577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/are%20we%20still%20avoiding%20internal%20specialization%3F/near/211395577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ashley Mannix <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/are.20we.20still.20avoiding.20internal.20specialization.3F.html#211395577">(Sep 27 2020 at 03:21)</a>:</h4>
<p>Thanks all! I’ll update our forge docs to reflect that internal uses of <code>min_specialization</code> are ok</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>